﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using Management.Areas.Control.Models;

namespace Management.Areas.Control
{
    public class OperationAttribute : AuthorizeAttribute
    {
        private LogModel logModel = new LogModel();
        public OperationAttribute()
        {            
            logModel.AccessDate = DateTime.Now;
            logModel.IsLog = true;
        }
        
        /// <summary>
        /// 操作日志
        /// </summary>
        /// <param name="modelName"></param>
        /// <param name="option"></param>
        /// <param name="remark"></param>
        public OperationAttribute(string modelName,string option,string remark="")
        {
            logModel.AccessDate = DateTime.Now;
            logModel.IsLog = true;
            logModel.ModuleName = modelName;
            logModel.Option = option;
            logModel.Operationremark = remark;
        }

    }
}